layui.use(['layer', 'form', 'admin', 'address', 'HttpRequest', 'iconPicker'], function () {
    let $ = layui.jquery;
    let HttpRequest = layui.HttpRequest;
    let form = layui.form;
    let admin = layui.admin;
    let address = layui.address;
    let orgId = Feng.getUrlParam("orgId");
    let request = new HttpRequest(Feng.ctxPath + "/kindergarten/detail?orgId=" + orgId, 'get');
    let result = request.start();
    form.val('KindergartenForm', result.data);
    new address("area_code",form,result.data.areaCode);

    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        data.field['orgId'] = orgId;
        console.info(data.field);
        var request = new HttpRequest(Feng.ctxPath + "/kindergarten/edit", 'post', function (data) {
            Feng.success("修改成功！");
            admin.putTempData('formOk', true);
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("添加失败！" + data.message)
        });
        request.set(data.field);
        request.start(true);
        return false;
    });
});
